import React, { Component } from 'react';
// 2. Router + history = BrowserRouter
import { Router, Route, Switch } from 'react-router-dom';
import AuthRoute from './components/AuthRoute';
import Layout from './pages/Layout';
import Login from './pages/Login';
import Test from 'pages/test';

import history from 'utils/history';

export default class App extends Component {
  render() {
    return (
      // 2.使用 Router 替换掉BrowserRouter  + history = BrowserRouter
      <Router history={history}>
        {' '}
        {/* 等价于 <BrowserRouter> */}
        <Switch>
          <Route path="/test" component={Test} />
          <Route path="/login" component={Login} />
          <AuthRoute path="/" component={Layout} count="123" number="react"></AuthRoute>
        </Switch>
      </Router>
    );
  }
}
